<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include :: appHeader"></head>
<body ontouchstart>
<!--首页 tabbar -->
<div class="weui-tab">
  <div class="weui-tab__bd">
    <div id="tab2" class="weui-tab__bd-item weui-tab__bd-item--active">
      <h1 th:if="${#lists.isEmpty(hisApply)}" style="margin-top: 64px;text-align: center">查无记录</h1>
      <div id="his-apply-list" class='demos-content-padded' th:unless="${#lists.isEmpty(hisApply)}">
        <div class="his-apply" th:each="ha : ${hisApply}">
          <div class="weui-form-preview__hd">
            <div class="weui-form-preview__item">
              <b class="weui-form-preview__label">生产令号</b>
              <b class="weui-form-preview__item" th:text="${ha.prodNo}"></b>
            </div>
            <div class="weui-form-preview__item">
              <b class="weui-form-preview__label">图号</b>
              <b class="weui-form-preview__item" th:text="${ha.drawNo}"></b>
            </div>
            <div class="weui-form-preview__item">
              <b class="weui-form-preview__label">零件名称</b>
              <b class="weui-form-preview__item" th:text="${ha.drawName}"></b>
            </div>
            <div class="weui-form-preview__item">
              <label class="weui-form-preview__label">工艺路线</label>
              <b class="weui-form-preview__item" th:text="${ha.route}"></b>
            </div>
            <div class="weui-form-preview__item">
              <label class="weui-form-preview__label">申请数量</label>
              <b class="weui-form-preview__item" th:text="${ha.num}"></b>
            </div>
            <div class="weui-form-preview__item">
              <label class="weui-form-preview__label">状态</label>
              <b class="weui-form-preview__item" th:text="${T(com.zw.transition.util.ServiceUtil).trans(ha.status)}"></b>
            </div>
          </div>
          <div class="weui-form-preview__ft" th:if="${ha.status == 1}">
            <button type="button" class="weui-form-preview__btn weui-form-preview__btn_primary"
                    th:onclick="|cancelApply(${ha.id})|">撤销申请
            </button>
          </div>
          <div class="weui-form-preview__ft" th:if="${ha.status == 4}">
            <button type="button" class="weui-form-preview__btn weui-form-preview__btn_default" th:onclick="|del(${ha.id})|">删除</button>
            <button type="button" class="weui-form-preview__btn weui-form-preview__btn_primary" th:onclick="|apply(${ha.id})|">重新申请</button>
          </div>
        </div>
      </div>
      <div style="height: 70px"></div>
    </div>
  </div>

  <div class="weui-tabbar">
    <a th:href="@{/index}" class="weui-tabbar__item weui-bar__item--on">
      <div class="weui-tabbar__icon">
        <img th:src="@{/img/me.png}" alt="">
      </div>
      <p class="weui-tabbar__label">我的信息</p>
    </a>

    <!--生产历史-->
    <a th:if="${#strings.contains(session.user.roles,'【申请质检】')}" th:href="@{/hisApply/null/null}" class="weui-tabbar__item">
      <div class="weui-tabbar__icon">
        <img th:src="@{/img/his_apply.png}" alt="">
      </div>
      <p class="weui-tabbar__label">历史申请</p>
    </a>
    <a th:if="${#strings.contains(session.user.roles,'【转序接收】')}" th:href="@{/hisRec/null/null}" class="weui-tabbar__item">
      <div class="weui-tabbar__icon">
        <img th:src="@{/img/his_rec.png}" alt="">
      </div>
      <p class="weui-tabbar__label">历史接收</p>
    </a>
    <a th:if="${#strings.contains(session.user.roles,'【转序质检】')}" th:href="@{/hisCheck/null/null}" class="weui-tabbar__item">
      <div class="weui-tabbar__icon">
        <img th:src="@{/img/his_check.png}" alt="">
      </div>
      <p class="weui-tabbar__label">历史质检</p>
    </a>
    <a th:if="${#strings.contains(session.user.roles,'【入库质检】')}" onclick="tips()" href="javascript:void(0)" class="weui-tabbar__item">
      <div class="weui-tabbar__icon">
        <img th:src="@{/img/his_check.png}" alt="">
      </div>
      <p class="weui-tabbar__label">入库历史质检</p>
    </a>
  </div>
</div>
<div th:include="include :: appFooter"></div>
<script th:src="@{/js/app-assembly.js}"></script>
</body>
</html>